package com.mice.loader
{
	import com.iyimo.event.LoadEvent;
	import com.iyimo.loader.MutilLoader;
	import com.iyimo.manager.SpriteManager;
	import com.mice.meta.MetaManager;
	
	public class XmlLoader extends MutilLoader{
		public function XmlLoader(){
			super();
		}
		
		override public function load(value:Array = null):void{
			super.load(value);
			loader.loadXml(source[_index]["url"]);
		}
		
		override protected function onComplete(e:LoadEvent):void{
			var xml:Object = source[_index];
			var data:XML = new XML(e.data);
			switch (xml.name){
				case "ui":
					SpriteManager.formatXml(data);
					break;
				case "meta":
					MetaManager.formatXml(data);
					break;
			}
			
			super.onComplete(e);
		}
	}
}